package com.alan.singleton;

/**
 * Created by Alan on 2018/8/20.
 *
 *  懒汉式，单例模式
 */
public class LazySingleton {

    private static LazySingleton instance;

    private LazySingleton(){}

    public static LazySingleton getInstance() {
        if(instance == null){
            instance = new LazySingleton();
        }
        return instance;
    }
}
